<div id="content">
  <div class="row s_page_title">
    <sa-big-breadcrumbs [items]="['日志信息管理', '数据修复[海螺]']" icon="fa fa-truck"
      class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
  </div>
  <sa-widgets-grid>
    <div class="s_table">
      <div sa-widget [editbutton]="false" color="darken" class="clearfix">
        <header>
          <span class="widget-icon"><i class="fa fa-table"></i></span>
          <h2>数据修复[海螺]</h2>
        </header>
        <div>
          <div class="widget-body no-padding">
            <div class="page-header clearfix s_table_opreation">
              <div class="left page-header-btn" style="width: calc(100% - 220px)">
                <!-- <sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)">
                </sa-company-tree-car> -->
                <div class="top_module">
                  <span class="module_text">公司名称</span>
                  <sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>
                </div>
                <div class="top_module">
                  <span class="module_text">推送状态</span>
                  <select name="" id="" class="module_inp" [(ngModel)]="pushState">
                    <option value="">全部</option>
                    <option value="0">待推送</option>
                    <option value="1">推送成功</option>
                    <option value="2">推送失败</option>
                    <option value="3">无需推送</option>
                  </select>
                </div>
                <div class="top_module">
                  <span class="module_text">推送单位</span>
                  <select class="module_inp" [(ngModel)]="pushTargetType">
                    <option value="">全部</option>
                    <option value="1">海螺</option>
                    <option value="2">矩阵</option>
                    <option value="3">中南水泥</option>
                    <option value="4">中联水泥</option>
                  </select>
                </div>
                <!-- <div class="top_module top_module_box cancle">
                  <span class="module_text">订单号</span>
                  <input type="text" class="module_inp top_module_select" [(ngModel)]="orderCode" placeholder="订单号" />
                  <div class="s_del_icon" (click)='delKey("orderCode")'>x</div>
                </div>
                <div class="top_module top_module_box cancle">
                  <span class="module_text">海螺设备号</span>
                  <input type="text" class="module_inp top_module_select" [(ngModel)]="haiLuoDeviceNo" placeholder="海螺设备号" />
                  <div class="s_del_icon" (click)='delKey("haiLuoDeviceNo")'>x</div>
                </div> -->
                <div class="selectDate top_module">
                  <table-select-date (outerTime)="getSelectTableTime($event)"></table-select-date>
                </div>

                <button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
                <!-- <button type="button" class="btn btn-primary" (click)="pushAll()">批量推送</button> -->
              </div>
              <div class="right top-search">
                <input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input"
                  placeholder="车牌号码、海螺设备号、订单号" />
                <span class="top-search-box">
                  <button class="top-search-btn" type="button" (click)="table_search()">
                    <i class="fa fa-search"></i>
                  </button>
                </span>
              </div>
            </div>
            <div class="table_scroll">
              <table
                class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                <thead>
                  <tr>
                    <th>操作</th>
                    <th>订单号</th>
                    <th>公司名称</th>
                    <th>车牌号码</th>
                    <th>设备ID</th>
                    <th>海螺设备号</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>推送单位</th>
                    <th>推送时间</th>
                    <th>推送状态</th>
                    <th>备注</th>
                    <th>创建时间</th>
                    <th>创建人</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i"
                    [ngClass]="{ selected: activeSelected === row.id }">
                    <td>
                      <button type="button" (click)="pushItem(row)">推送</button>
                    </td>
                    <td>{{ row.orderCode }}</td>
                    <td>{{ row.companyName }}</td>
                    <td>{{ row.carNumber }}</td>
                    <td>{{ row.deviceId }}</td>
                    <td>{{ row.haiLuoDeviceNo }}</td>
                    <td>{{ row.startTime }}</td>
                    <td>{{ row.endTime }}</td>
                    <td>
                      <span *ngIf="row.pushTargetType === 1">海螺</span>
                      <span *ngIf="row.pushTargetType === 2">矩阵</span>
                      <span *ngIf="row.pushTargetType === 3">中南水泥</span>
                      <span *ngIf="row.pushTargetType === 4">中联水泥</span>
                    </td>
                    <td>{{ row.pushDate }}</td>
                    <td>
                      <span *ngIf="row.pushState == '0'">待推送</span>
                      <span *ngIf="row.pushState == '1'" class="green">推送成功</span>
                      <span *ngIf="row.pushState == '2'" class="red">推送失败</span>
                      <span *ngIf="row.pushState == '3'">无需推送</span>
                    </td>
                    <td>{{ row.remark }}</td>
                    <td>{{ row.createTime }}</td>
                    <td>{{ row.createUser }}</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="table-fix clearfix">
              <paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
                (onPageChange)="paginate($event)"></paginator>
              <button type="button" class="btn default refresh_btn" (click)="refresh()">
                <i class="fa fa-refresh"></i>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </sa-widgets-grid>
</div>